<?php

require("page_start.php");

print("
<p><p>
<table align=\"center\" width=\"50%\">
<tr><td>
<fieldset align=\"top\">
	<legend>Adicionar Usu&aacute;rio</legend>
<center>
	<form  action=\"add_user.php\" method=\"POST\">
		Usu&aacute;rio: <input type=\"text\" name=\"usuario\">
		<input type=\"submit\" value=\"OK\">
	</form>
</center>
</fieldset>
");

print "<p>\n <p>\n";


require_once("conf/mysql_conf.php");

mysql_connect($server,$usuario,$password) or die("Can't Connect" . mysql_error());
mysql_select_db($database);

$lista=mysql_query("SELECT usuario FROM usuarios ORDER BY 'usuario'");
print '<center>';

print '<p><p>';

print '<fieldset> <legend>Usu&aacute;rios</legend>';
print "<table style=\"text-align: center\"; border=0>\n";


$num=1;


while ( $linha = mysql_fetch_array($lista) ) {

	$cellcolor='background-color: rgb(192, 201, 157)';
	
	print "<tr>\n";
	print "<td style=\" $cellcolor ;  width: 30px;\"><center>" . $num . "</center></td>";
	print "<td style=\" $cellcolor ;  width: 100px;\"><center>" . $linha['usuario'] . "</center></td>";
	print "<td style=\" $cellcolor ;  width: 60px;\"><center><A HREF=del_user.php?usuario=" . $linha["usuario"] . ">DELETE</a></center></td>";
	print "<td style=\" $cellcolor ;  width: 60px;\"><center><A HREF=user_reset_pass.php?usuario=" . $linha["usuario"] . ">RESET_PASS</a></center></td>";
	print "</tr>\n";
		
	$num++;

}
print '</fieldset></td></tr></table>';

require("page_end.php");

?>
